﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autofac.Integration.Web;

namespace WebFormsMvp.Contrib.Autofac.Tests
{
    class StubContainerProvider : IContainerProvider
    {
        private global::Autofac.IContainer iContainer;

        public StubContainerProvider(global::Autofac.IContainer iContainer)
        {
            this.iContainer = iContainer;
        }
        #region IContainerProvider Members

        public global::Autofac.IContainer ApplicationContainer
        {
            get { return iContainer; }
        }

        public void EndRequestLifetime()
        {
            iContainer.Dispose();
        }

        public global::Autofac.ILifetimeScope RequestLifetime
        {
            get { return iContainer; }
        }

        #endregion
    }
}
